import VueRouter from "vue-router"
import Vue from "vue"
import Login from '../view/login/index.vue'
import Chat from '../view/chat/index.vue'
import ChatOnline from '../view/chat/chat-online.vue'
import ChatWeixin from '../view/chat/weixin.vue'

Vue.use(VueRouter);
const routes = [
    {
        path: '/',
        redirect: '/login',
    },
    {
        name: 'login',
        path: '/login',
        component: Login,
        
    },
    {
        name: 'chat',
        path: '/chat',
        component: Chat,
        redirect: '/chat/chat-weixin',
        children: [
            {
                name: 'chat-online',
                path: 'chat-online',
                component: ChatOnline,
            },
            {
                name: 'chat-weixin',
                path: 'chat-weixin',
                component: ChatWeixin,
            }
        ]
    }
]

export default new VueRouter({
    routes
})